QuickOPC User's Guide and Reference
SubscribeMultipleItems(IEasyDAClient,DAItemGroupArguments[],EasyDAItemChangedEventHandler) Method



OpcLabs.EasyOpcClassicCore Assembly > OpcLabs.EasyOpc.DataAccess Namespace > IEasyDAClientExtension Class > SubscribeMultipleItems Method : SubscribeMultipleItems(IEasyDAClient,DAItemGroupArguments[],EasyDAItemChangedEventHandler) Method
The client object that will perform the operation.
Array of arguments, one element per each OPC item involved in the operation.
A callback method to be invoked for each significant item change.
Subscribe to changes of multiple OPC items. Subscribe to changes of multiple OPC items with a callback method. The ItemChanged event will be generated for each significant item change, and a specified callback method will be invoked.
Syntax
'Declaration
 
<ExtensionAttribute()>
<NotNullAttribute()>
Public Overloads Shared Function SubscribeMultipleItems( _
   ByVal client As IEasyDAClient, _
   ByVal itemGroupArgumentsArray() As DAItemGroupArguments, _
   ByVal callback As EasyDAItemChangedEventHandler _
) As Integer()
'Usage
 
Dim client As IEasyDAClient
Dim itemGroupArgumentsArray() As DAItemGroupArguments
Dim callback As EasyDAItemChangedEventHandler
Dim value() As Integer
 
value = IEasyDAClientExtension.SubscribeMultipleItems(client, itemGroupArgumentsArray, callback)

Parameters

client
The client object that will perform the operation.
itemGroupArgumentsArray
Array of arguments, one element per each OPC item involved in the operation.
callback
A callback method to be invoked for each significant item change.

Return Value

The function returns an array of integer handles. Each such uniquely identifies the item subscription. The indices of elements in the output array are the same as those in the input array, itemGroupArgumentsArray.
Exceptions
ExceptionDescription

A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

Remarks

The size of the input array will become the size of the output array. The element positions (indices) in the output array are the same as in the input array.

If callback is a null reference, only the ItemChanged events are generated, but no callback method is invoked.

 

This method operates (at least in part) asynchronously, with respect to the caller. The actual execution of the operation may be delayed, and the outcome of the operation (if any) is provided to the calling code using an event notification, callback, or other means explained in the text. In a properly written program, this method does not throw any exceptions. You should therefore not put try/catch statements or similar constructs around calls to this method. The only exceptions thrown by this method are for usage errors, i.e. when your code violates the usage contract of the method, such as passing in invalid arguments or calling the method when the state of the object does not allow it. Any operation-related errors (i.e. errors that depend on external conditions that your code cannot reliably check) are indicated by the means the operation returns its outcome (if any), which is described in the text. For more information, see Do not catch any exceptions with asynchronous or multiple-operation methods.
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also